package cn.iocoder.yudao.module.promotion.controller.admin.banner.vo;

import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.validation.InEnum;
import cn.iocoder.yudao.module.promotion.enums.banner.BannerPositionEnum;
import cn.iocoder.yudao.module.promotion.enums.banner.BannerPutTypeEnum;
import cn.iocoder.yudao.module.promotion.enums.banner.BannerTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * Banner Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 *
 * @author xia
 */
@Data
public class BannerBaseVO {

    @Schema(description = "标题", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "标题不能为空")
    private String title;

    @Schema(description = "类型(1:图片;2:内链;3:外链;4:富文本编辑)", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "类型不能为空")
    @InEnum(BannerTypeEnum.class)
    private Integer type;

    @Schema(description = "跳转链接(内链;外链)", requiredMode = Schema.RequiredMode.REQUIRED)
//    @NotNull(message = "跳转链接不能为空")
    private String url;

    @Schema(description = "图片地址", requiredMode = Schema.RequiredMode.REQUIRED)
//    @NotNull(message = "图片地址不能为空")
    private String picUrl;

    @Schema(description = "内容", requiredMode = Schema.RequiredMode.REQUIRED)
    private String content;

    @Schema(description = "位置(1:首页;2:秒杀活动页;3:砍价活动页;4:限时折扣页;5:满减送页;6:首页弹框;7:点餐页banner;8:排行榜介绍)", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "位置不能为空")
    @InEnum(BannerPositionEnum.class)
    private Integer position;

    @Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "排序不能为空")
    private Integer sort;

    @Schema(description = "投放类型(1:总是显示;2:按日期显示)", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "投放类型不能为空")
    @InEnum(BannerPutTypeEnum.class)
    private Integer putType;

    @Schema(description = "投放开始时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-01-01 23:59:59")
    private LocalDateTime putTimeStart;

    @Schema(description = "投放结束时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-01-01 23:59:59")
    private LocalDateTime putTimeEnd;

    @Schema(description = "店铺ID", example = "1")
    private Long storeId;

    @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "状态不能为空")
    @InEnum(CommonStatusEnum.class)
    private Integer status;

    @Schema(description = "备注")
    private String memo;

}
